package example

import "go-amis-admin/admin"

type TodoModule struct {
	admin.EmptyModule
	TodoView
	TodoController
}

func Setup(site *admin.Site) {
	admin.Instance.DB.AutoMigrate(&Todo{}, &Category{})
	var categoryModule = admin.NewCrudModule("代办分类", "category", "fa fa-bars", "/admin",
		100, Category{}, nil, nil, nil)

	todoModule := &TodoModule{
		EmptyModule:    admin.NewEmptyModule("代办列表", "todo", "fa fa-check-circle", 100, "/admin"),
		TodoController: TodoController{},
		TodoView:       TodoView{},
	}

	site.Mount(admin.NewFloder("示例", "example", "fa fa-cube", 200).
		AddModule(&categoryModule, todoModule))
}
